package com.slkj.shilixiaoyuanapp.entity;

import android.graphics.Color;

import static com.slkj.shilixiaoyuanapp.entity.Enum.AdministrationToolType.getByValue;

/**
 * Created  on 2018-09-10
 *
 * @author 唐开阔
 * @describe
 */
public class MyApprovalHisEntity {
    private boolean isCheck = false;//是否选中
    /**
     * applyId : 0
     * intime : 2018-09-10
     * name : 任浩
     * id : 218
     * state : 0
     * title : sg测试
     * type : 9
     */

    private int applyId;
    private String intime;
    private String name;
    private int id;
    private int state;
    private String title;
    private int type;
    private int auditId;

    public int getAuditId() {
        return auditId;
    }

    public void setAuditId(int auditId) {
        this.auditId = auditId;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public int getApplyId() {
        return applyId;
    }

    public void setApplyId(int applyId) {
        this.applyId = applyId;
    }

    public String getIntime() {
        return intime;
    }

    public void setIntime(String intime) {
        this.intime = intime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
    public int getTypeColor(){
        int color = 0;
        switch (state){
            case  0:
                color = Color.parseColor("#999999");
                break;
            case  1:
                color = Color.parseColor("#FF6953");

                break;
            case  2:
                color = Color.parseColor("#0087FC");

                break;
        }
        return color;
    }
    public String getTypeText(){
        String text ="";
        switch (state){
            case  0:
                text = "待审批";
                break;
            case  1:
                text = "未通过";

                break;
            case  2:
                text = "已通过";

                break;
        }
        return text;
    }

    public int getImg() {
        if (getByValue(getType()) == null){
            return -1;
        }else {
            return getByValue(getType()).getIconRes();
        }
    }
}
